// 获取token
function getLocal (key = 'heimamm_mobile_token') {
  return window.localStorage.getItem(key)
}
// 保存token
function setLocal (val, key = 'heimamm_mobile_token') {
  window.localStorage.setItem(key, val)
}
// 移除token
function removeLocal (key = 'heimamm_mobile_token') {
  window.localStorage.removeItem(key)
}

function mySetLocal (key, value) {
  window.localStorage.setItem(key, JSON.stringify(value))
}

function myGetLocal (key) {
  return JSON.parse(window.localStorage.getItem(key))
}

function myRemoveLocal (key) {
  window.localStorage.removeItem(key)
}
// 暴露
export {
  getLocal,
  setLocal,
  removeLocal,
  mySetLocal,
  myGetLocal,
  myRemoveLocal
}
